package com.niiwoo.civet.scheduler.trigger;

import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import com.alibaba.dubbo.config.annotation.Reference;
import com.alibaba.dubbo.rpc.RpcContext;
import com.niiwoo.civet.trade.service.intelligenceInvest.IntelligenceInvestDubboService;

import lombok.extern.slf4j.Slf4j;

/**
 * 智能投包流标
 * 
 * @author liuchun
 *
 *         2018年11月6日
 */
@Component
@Slf4j
public class IntelligenceFlowJobTrigger {
	@Reference(version = "1.0.0")
	private IntelligenceInvestDubboService intelligenceInvestDubboService;

	@Scheduled(cron = "${intelligence.flow}")
	public void intelligenceFlow() {
		log.info("定时触发智能投流包开始");
		RpcContext.getContext().asyncCall(()->intelligenceInvestDubboService.flow());
		log.info("定时触发智能投流包结束");
	}
}
